﻿Ext.Loader.setPath('Happy', '../../src');
Ext.require('Happy.designer.Panel');

Ext.onReady(function () {
    var view = Ext.create('Ext.container.Viewport', {
        layout: 'fit',
        items: {
            xtype: 'happy-designer-panel',
            title: '流程设计器'
        }
    });

    var designer = view.down('happy-designer-panel');

    designer.addNode({
        type: 'Happy.designer.Rectangle',
        nodeId: '001',
        text: '开始'
    });

    designer.addNode({
        type: 'Happy.designer.Ellipse',
        nodeId: '002',
        text: 'Split'
    });

    designer.addNode({
        type: 'Happy.designer.Rectangle',
        nodeId: '003',
        text: '人事领导审批'
    });

    designer.addNode({
        type: 'Happy.designer.Rectangle',
        nodeId: '004',
        text: '考核领导审批'
    });

    designer.addNode({
        type: 'Happy.designer.Ellipse',
        nodeId: '005',
        text: 'Join'
    });

    designer.addNode({
        type: 'Happy.designer.Rectangle',
        nodeId: '006',
        text: '结束'
    });
});